<div class="tapBar">
    <p class="set">
        <a href="javascript:updateUserInfo();" id="update" url="{{url("usermanage/updateUserInfo")}}" ><img src="<?php echo $this->session->get('img'); ?>" alt="" class="avatar"><span><?php echo $this->session->get('realName'); ?></span></a>
        <a href="javascript:;" title="退出登录"  class="loginOut"><i id='btnlogout'  url="{{url("login/ajaxLogout")}}" jumpUrl="{{url("login/login")}}"></i></a>
    </p>
    <p class="t">主播还能更好玩啊！</p>
</div>
<script>

     function updateUserInfo(){
         var url = $('#update').attr('url');
         $.msgbox({
             height: 120,
             content: {type: 'confirm', content: "确定需要修改用户信息吗？"},
             onClose: function (result) {
                 if (result) {
                     window.location.href = url;
                 }
             }
         });
    }

    $(window).load(function () {
        $('#btnlogout').click(function () {
            var url = $("#btnlogout").attr("url");
            var jumpUrl = $("#btnlogout").attr("jumpUrl");
            var json = {
            };
            var successFunction = function (data) {
                if (data.status == 200) {
                    alert("退出成功");
                    window.location.href = jumpUrl;
                } else if (data.status == -1) {
                    alert(data.info);
                }
            };
            var errorFunction = function () {

            };
            $.ajax({
                url: url,
                data: json,
                type: "post",
                error: errorFunction,
                success: successFunction
            });
        });

    });
</script>


<div class="mainBox">
    <div class="main">